<template>
  <div id="app">
    <el-menu
      class="el-menu-demo"
      mode="horizontal"
      router
      :default-active="$route.path"
      :active-text-color="activeColor"
    >
      <el-menu-item
        v-for="(item,index) in navList"
        :key="index"
        :index="item.url"
      >
        <i class="iconfont"
           :class="item.icon"
        ></i>
        {{item.name}}
      </el-menu-item>
    </el-menu>
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  data () {
    return {
      activeColor: '#18cb70',
      navList: [ // 传给导航组件的数据
        {
          name: '办公应用',
          url: '/officialCenter',
          icon: 'icon-house'
        },
        {
          name: '教学&班级应用',
          url: '/teachCenter',
          icon: 'icon-icon_xcc-'
        }
      ]
    }
  },
  computed: {
    // module () {
    //   return this.$store.state.module
    // }
  },
  methods: {

  },
  mounted () {
    // this.roles = localStorage.getItem('roles')
  }
}
</script>

<style scoped lang="scss">

</style>
